<html>
<head>
<title>Opening Connection and selecting a database</title>
</head>
<body>
<?php
$db = "apc_vote";
$link = mysql_connect("localhost","root");
if(!$link){
die("Couldn't connect to MySQL");
}else{
print "Connected to server";
mysql_select_db($db) or die("Couldnt Open");
$query = "CREATE TABLE dishes(dish_id INT, dish_name VARCHAR(255),price DECIMAL(4,2),is_spicy INT)";
$result = mysql_query($query);
print "Connected to database";
mysql_close($link);
}
?>
</body>